// 在接口返回值不明确的情况下使用
function fu<T>(a: T): T {
    return a
}

const value = fu<number>(666)
console.log(value)

interface myInfo {
    name: string
}

function info<T extends myInfo>(a: T): string {
    return a.name
}

const z = info({ name: '1', age: 11 })
console.log(z)

class Animal<T> {
    name: T
    constructor(name: T) {
        this.name = name
    }
}

const cat = new Animal('gao')
console.log(cat)
